How to: Add a command button to run a macro to a form.
Solution:
In the Form Design view, use the 'Command Button' on the Toolbox. Click on the form to insert the command button. Follow the steps for the wizard, selecting 'Miscellaneous' and 'Run Macro' from the list boxes.
1) If the Database window is not activated, activate the Database window.
2) Click the 'Forms' tab in the Database window.
Forms tab
3) Select the desired form from the list box. (The selected form is highlighted.)
4) Click 'Design'. (The selected form appears in Design view, and the floating Toolbox appears.)
5) Make sure the 'Control Wizard' located in the Toolbox is depressed.
Control Wizard depressed and selected bound control
6) Click 'Command Button' on the Toolbox.
7) Position the mouse pointer on the form to select the location for the command button.
8) Click location for the command button on the form. (The Command Button Wizard appears.)
9) Select 'Miscellaneous' from the 'Categories' list box.
10) Select 'Run Macro' from the 'Actions' list box.
Command Button Run Macro
11) Click 'Next'. (The next step of the wizard appears.)
12) Select the desired macro from the 'What macro would you like to run?' list box.
13) Click 'Next'. (The next step of the wizard appears.)
14) To type text as the command button, do the following:
a) Select the 'Text' radio button.
b) Type the text that will appear on the command button in the 'Text' box.
15) To select a picture as the command button, do the following:
a) Select the 'Picture' radio button.
b) Select the name of the picture from the 'Picture' list box.
16) Click 'Next'. (The next step of the wizard appears.)
17) Type the name for the command button in the 'What do you want to name the button?' box.
18) Click 'Finish'. (The command button appears on the form.)
19) Select the 'File' menu and select 'Save' to save the form.